import axios from 'axios'

const client = axios.create({
  baseURL: 'http://localhost:3000/',
  timeout: 1000,
  headers: {'X-Custom-Header': 'foobar'}
});

class Upload {
  static getUploadedChunks(params?: any) {
    return client({
      url: "files/get_uploaded_chunks",
      method: "get",
      params,
    });
  }

  static uploadChunk(data?: any) {
    return client({
      url: "files/upload_chunk",
      method: "post",
      data,
    });
  }

  static mergeChunks(params?: any) {
    return client({
      url: "files/merge_chunks",
      method: "get",
      params,
    });
  }
}

export { Upload };
